<template>
	
	<view class="newsbox">
		
		<view class="pic">
			<image :src="item.goodsLogo" mode="aspectFill"></image>
		</view>
		<view class="text">
			<view class="title">				
				{{item.goodsName}}
			</view>
			<view class="title-menoy">
				￥{{item.marketPrice}}
			</view>
			<view class="info" v-if="!item.looktime">
				<text>浏览{{item.clickCount}}</text>
				<!-- {{item.hits}} -->
				<text>库存{{item.storeCount}}</text>
			</view>
			<!-- <view class="info" v-else>
				<text>浏览时间：{{item.looktime}}</text>
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		name:"newshop",
		props:{
			item:{
				type:Object,
				default(){
					return {
						title:"组件内默认的标题",
						author:"张三",
						hits:668,
						picurl:"../../static/images/nopic.jpg"
					}
				}
			}
		},
		data() {
			return {
				
			};
		}
	}
</script>

<style lang="scss">
.newsbox{
	display: flex;
	margin-top:20px ;
	//box-shadow:0 0 20upx rgba(0,0,0,0.15);
	border-radius: 10px;
	.pic{
		width: 230rpx;
		height: 230rpx;
		text-align: center;
		
		image{
			width: 90%;
			height: 90%;
			margin-top: 5%;
			border-radius: 10px;
			flex: none;
		}
	}
	.text{		
		flex:1;
		padding-left:20rpx;
		display: flex;
		flex-direction: column;
		//justify-content: space-between;
		.title{
			width: 98%;
			height: 40%;
			margin-top: 10px;
			font-size: 30rpx;
			font-weight: bold;
			color:#333;
			text-overflow: -o-ellipsis-lastline;
			// overflow: hidden;				//溢出内容隐藏
			text-overflow: ellipsis;		//文本溢出部分用省略号表示
			display: -webkit-box;			//特别显示模式
			-webkit-line-clamp: 2;			//行数
			line-clamp: 2;					
			-webkit-box-orient: vertical;	//盒子中内容竖直排列			
		}
		.title-menoy{
			height: 30%;
			color: #cb0000;
		}
		
		.info{
			height: 30%;
			font-size: 26rpx;
			//color:#999;
			text{
				padding-right: 30rpx;
			}
		}
	}
}
</style>